#include <iostream>
using namespace std;
    template <class T>
    class Triple {
        T values[3];
      public:
        Triple(T first ,T second,T third) {
          values[0] = first; values[1] = second; values[2] = third;
        }
        T average();
        T max();
        T min();
    };
    template <class T>
    T Triple<T>::max()
    {
        T retval;
        retval = values[0] > values[1] ? values[0] : values[1];
        retval = retval > values[2] ? retval : values[2];
        return retval;
    }

    template <class T>
    T Triple<T>::min()
    {
        T retval;
        retval = values[0] > values[1] ? values[1] : values[0];
        retval = retval < values[2] ? retval : values[2];
        return retval;
    }
    template <class T>
    T Triple<T>::average()
    {
        return (values[0]+values[1]+values[2])/3;
    }
int main(){
    Triple<double> coordinates(100.0,75.0,60.0);
    cout << coordinates.max() << endl;
    cout << coordinates.min() << endl;
    cout << coordinates.average() << endl;

}
